<?php
class Draw2Card extends BaseCard
{
	function Draw2Card($color)
	{
		$this->color = $color;
		$this->num = 2;
		$this->type = Draw2;
	}
	function equal($state)
	{
		return (($state->color == $this->color || $state->type == $this->type) && $state->type != WildDraw) || ($state->punished && $state->type == $this->type);
	}

	function overlay($state)
	{
		$state->punished = false;
		
		$state->type = $this->type;
		$state->color = $this->color;

		if($state->num == 1)
		{
			$state->num = 2;
		}else{
			$state->num += $this->num;
		}
	}
}